package com.zr.controller.finance;

import com.zr.service.finance.FinanceInvoiceService;
import com.zr.utils.AjaxResult;
import com.zr.vo.finance.FinanceInvoice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/finance/invoice")
public class FinanceInvoiceController {

    //service实现类
    @Autowired
    private FinanceInvoiceService financeInvoiceService;


    /**
     * @author wanglu
     * 查询发票列表
     * @param financeInvoice
     * @return
     */
    @PostMapping("/getList")
    public AjaxResult getList(@RequestBody FinanceInvoice financeInvoice){
        return AjaxResult.success(200,"查询成功",financeInvoiceService.getList(financeInvoice));
    }

    /**
     * @author wanglu
     * 增加发票
     * @param financeInvoice
     * @return
     */
    @PostMapping("/add")
    public AjaxResult add(@RequestBody FinanceInvoice financeInvoice){
        return AjaxResult.success(200,"添加成功",financeInvoiceService.add(financeInvoice));
    }


}
